# -*- coding: utf-8 -*-
# @Time    : 2023/6/5 11:05
# @Author  : hyh
# @Email   : 935887145@qq.com
# @File    : view_follow_page.py
# @Software: PyCharm
from pages.base_page import BasePage
from appium import webdriver
from tools import driver
from appium.webdriver.common.mobileby import MobileBy as By
from selenium.webdriver.support.wait import WebDriverWait
from selenium.webdriver.support import  expected_conditions as EC
class ViewFollowPage(BasePage):
    guanzhu_locator = (By.XPATH,'//*[@text="关注"]')
    tishi_locator = (By.XPATH,'//*[@resource-id="com.xiachufang:id/tv_load_status_major"]')
    author_name_locator=(By.ANDROID_UIAUTOMATOR,'new UiSelector().className(\"android.widget.TextView\").textContains(\"面少SanSan\").resourceId(\"com.xiachufang:id/tv_user_item_name\")')

    def chakan(self):
        self.find_element(self.guanzhu_locator).click() #查看我的关注
    def tishi(self):
        current_wenben = self.find_element(self.tishi_locator).get_attribute('text') #获取文本
        return current_wenben
    def author_name(self):
        name=self.find_element(self.author_name_locator).text
        return name